3.3 \(\int (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=46 \[ -\frac{a (B+i A) \log (\cos (c+d x))}{d}+a x (A-i B)+\frac{i a B \tan (c+d x)}{d} \]

[Out]

a*(A - I*B)*x - (a*(I*A + B)*Log[Cos[c + d*x]])/d + (I*a*B*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0278612, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3525, 3475} \[ -\frac{a (B+i A) \log (\cos (c+d x))}{d}+a x (A-i B)+\frac{i a B \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

a*(A - I*B)*x - (a*(I*A + B)*Log[Cos[c + d*x]])/d + (I*a*B*Tan[c + d*x])/d

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=a (A-i B) x+\frac{i a B \tan (c+d x)}{d}+(a (i A+B)) \int \tan (c+d x) \, dx\\ &=a (A-i B) x-\frac{a (i A+B) \log (\cos (c+d x))}{d}+\frac{i a B \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0263979, size = 66, normalized size = 1.43 \[ -\frac{i a A \log (\cos (c+d x))}{d}+a A x-\frac{i a B \tan ^{-1}(\tan (c+d x))}{d}+\frac{i a B \tan (c+d x)}{d}-\frac{a B \log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

a*A*x - (I*a*B*ArcTan[Tan[c + d*x]])/d - (I*a*A*Log[Cos[c + d*x]])/d - (a*B*Log[Cos[c + d*x]])/d + (I*a*B*Tan[
c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 81, normalized size = 1.8 \begin{align*}{\frac{iaB\tan \left ( dx+c \right ) }{d}}+{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) A}{d}}+{\frac{a\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) B}{2\,d}}-{\frac{iaB\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}}+{\frac{aA\arctan \left ( \tan \left ( dx+c \right ) \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

I*a*B*tan(d*x+c)/d+1/2*I/d*a*ln(1+tan(d*x+c)^2)*A+1/2/d*a*ln(1+tan(d*x+c)^2)*B-I/d*a*B*arctan(tan(d*x+c))+1/d*
a*A*arctan(tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.66479, size = 68, normalized size = 1.48 \begin{align*} \frac{2 \,{\left (d x + c\right )}{\left (A - i \, B\right )} a -{\left (-i \, A - B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 i \, B a \tan \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*(A - I*B)*a - (-I*A - B)*a*log(tan(d*x + c)^2 + 1) + 2*I*B*a*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.36108, size = 161, normalized size = 3.5 \begin{align*} -\frac{2 \, B a -{\left ({\left (-i \, A - B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} +{\left (-i \, A - B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

-(2*B*a - ((-I*A - B)*a*e^(2*I*d*x + 2*I*c) + (-I*A - B)*a)*log(e^(2*I*d*x + 2*I*c) + 1))/(d*e^(2*I*d*x + 2*I*
c) + d)

________________________________________________________________________________________

Sympy [A]  time = 2.38147, size = 58, normalized size = 1.26 \begin{align*} - \frac{2 B a e^{- 2 i c}}{d \left (e^{2 i d x} + e^{- 2 i c}\right )} - \frac{a \left (i A + B\right ) \log{\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

-2*B*a*exp(-2*I*c)/(d*(exp(2*I*d*x) + exp(-2*I*c))) - a*(I*A + B)*log(exp(2*I*d*x) + exp(-2*I*c))/d

________________________________________________________________________________________

Giac [B]  time = 1.34306, size = 139, normalized size = 3.02 \begin{align*} \frac{-i \, A a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - B a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 \, B a}{d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

(-I*A*a*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) - B*a*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) + 1
) - I*A*a*log(e^(2*I*d*x + 2*I*c) + 1) - B*a*log(e^(2*I*d*x + 2*I*c) + 1) - 2*B*a)/(d*e^(2*I*d*x + 2*I*c) + d)